package com.xxg.renrenproduct.dao;

import com.xxg.renrencommon.domain.dao.BaseMapper;
import com.xxg.renrencommon.domain.dao.RenrenShopGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RenrenShopGoodsDao extends BaseMapper<RenrenShopGoods, Integer> {
    @Select("SELECT count(*) FROM renren_shop_goods WHERE id = #{id,jdbcType=INTEGER}")
    long countById(Integer id);

    @Select("SELECT shop_id FROM renren_shop_goods WHERE id = #{id,jdbcType=INTEGER}")
    Integer selectShopIdByPrimaryKey(Integer id);

    @Select("SELECT count(1) FROM renren_shop_goods WHERE id = #{id,jdbcType=INTEGER} AND shop_id = #{shopId,jdbcType=INTEGER}")
    long countByIdAndShopId(Integer id, Integer shopId);
}